<template>
  <div class="floor">
    <div class="con">
      <div class="touxiang">
        <img src="../assets/floor_t.png" />
        <!-- <span>帮帮同城</span> -->
      </div>
      <div class="gengduo">
        <span @click="toXieyi(1)">关于我们</span>
        <span @click="toXieyi(7)">联系我们</span>
        <span @click="openfeedback">意见反馈</span>
        <span @click="toXieyi(2)">隐私声明</span>
      </div>
	  <div class="InternetContentProvider">
		<div style="cursor: pointer">
		  <a
			target="_blank"
			href="http://www.beian.gov.cn/portal/registerSystemInfo"
			style="
			  display: inline-block;
			  text-decoration: none;
			  height: 20px;
			  line-height: 20px;
			  margin-right: 10px;
			"
			><img src="@/assets/jing.png" style="float: left; width: 20px" />
			<p
			  style="
				float: left;
				height: 20px;
				line-height: 20px;
				margin: 0px 0px 0px 5px;
			  "
			>
			鲁公网安备 37028302000834号
			</p></a
		  >
		  <div @click="icp" >鲁ICP备2022008924号</div>
		</div>
	  </div>
      <!-- <div class="weima">
        <img src="../assets/ewm.png" />
        <p>App下载</p>
      </div> -->
    </div>
		<div v-if="feedbackstate" class="fkmb" @click="feedbackstate = false"></div>
		<div v-if="feedbackstate" class="wtfk">
			<div style="color: #000000;font-size: 24px;font-weight: 400;">问题反馈</div>
			<div class="close" @click="feedbackstate = false"><img style="width:100%;height:100%" src="../assets/close.png"></div>
			<el-input
			  type="textarea"
			  placeholder="请详细输入您的问题"
			  v-model="textarea"
			  maxlength="300"
			  show-word-limit
				:autosize="{ minRows: 4, maxRows: 10}"
			>
			</el-input>
			<div style="text-align: center;margin: 10px 0;">
				<el-upload :action="$upLoad" list-type="picture-card"
					:on-success="houseSuccess" :on-remove="houseRemove" :accept="$imgSuffixArr"  :limit="9">
					<i class="el-icon-plus"></i>
				</el-upload>
			</div>
			<div class="botton" @click="subitmfb">提交反馈</div>
		</div>
  </div>
</template>
<script>
	export default{
		data(){
			return{
				id:'',
				feedbackstate:false,
				textarea:'',
				user:{},
				houseImage:[],
			}
		},
		methods:{
			toXieyi(id){
				window.open('https://www.bangbangtongcheng.com/conven_pc/#/index/particulars?type=prot&id='+id,'_blank')
			},
			icp() {
				window.open("https://beian.miit.gov.cn/#/Integrated/index");
		    },
			//打开反馈
			openfeedback(){
				let user = JSON.parse(localStorage.getItem("userInfo"))
				if(user!=null){
					this.user = user
					this.feedbackstate = true
				}else{
					this.$message({
					  message: "请登录之后在反馈问题！",
					  type: "error",
					  offset: 120,
					  duration: 2000,
					});
				}
			},
			//提交反馈
			subitmfb(){
				if(this.textarea == ''){
					this.$message({
					  message: "请填写详细问题！",
					  type: "error",
					  offset: 120,
					  duration: 2000,
					});
					return;
				}
				if(String(this.houseImage) == ''){
					this.$message({
					  message: "请上传图片！",
					  type: "error",
					  offset: 120,
					  duration: 2000,
					});
					return;
				}
				// let imgs = []
				// this.houseImage.forEach((e) =>{
				// 	imgs.push(e.path)
				// })
				var data = {
					feedbackPerson: JSON.parse(localStorage.getItem("userInfo")).id,
					content: this.textarea,
					feedbackPicture: this.houseImage.map(item=>item.path).join("|")
				};
				if(this.loading){
					return
				}
      			this.loading = true
				this.$postHttp("/api/mobile/public/increaseProblemFeedback", data).then(res => {
					if (res.code == 200) {
					
					this.$message({
						message: "反馈成功！",
						type: "success",
						offset: 120,
						duration: 2000,
					});
						this.feedbackstate = false
						this.textarea = ''
						this.houseImage = []
					// this.leibieClick(2) 
					}
						this.loading = false
					
				});
				return
				var data = {
				  userId: this.user.id,
				  delFlag: 0,
				  feedback: this.textarea,
				  image: imgs.join("|")
				};
				this.$postHttp('/mob/user/subOpinion',data).then((data) =>{
					if(data.code == 200){
						this.$message({
						  message: "反馈成功！",
						  type: "success",
						  offset: 120,
						  duration: 2000,
						});
						this.feedbackstate = false
						this.textarea = ''
						this.houseImage = []
					}
				})
			},
			houseSuccess(response, file, fileList) {
				this.houseImage.push({
					id: file.uid,
					path: response.data[0].url,
				})
			},
			houseRemove(file, fileList) {
				for (var i = 0; i < this.houseImage.length; i++) {
					if (this.houseImage[i].id == file.uid) {
						this.houseImage.splice(i, 1)
					}
				}
			},
		}
	}
</script>
<style lang="less" scoped>
.fkmb{
	width: 100%;
	height: 100%;
	background-color: #999999;
	opacity: 0.5;
	z-index: 9;
	position: fixed;
	top: 0px;
}
.wtfk{
	position: fixed;
	z-index: 99999;
	width: 400px;
	height: 550px;
	align-items: center;
	justify-content: space-between;
	padding: 20px 0px;
	box-sizing: border-box;
	background-color: #FFFFFF;
	border-radius: 10px;
	top: 0px;
	bottom: 0px;
	left: 0px;
	right: 0px;
	margin: auto;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	.close{
		width: 20px;
		position: absolute;
		right: 20px;
		top: 10px;
		cursor: pointer;
	}
	.botton{
		color: #FFFFFF;
		background-color: #64B6A8;
		border-radius: 20px;
		width: 300px;
		height: 40px;
		text-align: center;
		line-height: 40px;
		cursor: pointer;
	}
}
.floor {
  position:absolute;;
  bottom: 0;
  width: 100%;
  height: 210px;
  background-color: #64b6a8;
}
.con {
  position: relative;
  width: 1200px;
  height: 100%;
  margin-left: 50%;
  transform: translateX(-50%);
  .touxiang{
    position: absolute;
    top: 40px;
    left: 40px;
    img{
      /* width: 60px;
      height: 60px; */
      margin-right: 20rpx;
    }
    span{
      font-size: 28px;
      vertical-align: middle;
    }
  }
  .gengduo{
    position: absolute;
    bottom: 60px;
    left: 40px;
    span{
      margin-right: 63px;
      font-size: 18px;
      cursor: pointer;
    }
  }
  .weima{
    position: absolute;
    top:24px;
    right: 0;
    img{
      width: 120px;
      height: 120px;
    }
    p{
      width: 100%;
      text-align: center;
      margin-top: 12px;
    }
  }
}
/deep/.el-textarea{
	width: 80%;
}
.InternetContentProvider {
  width: 100%;
  height: 50px; 
  line-height: 50px;
  position: absolute;
    bottom: 0px;
  > div {
    display: flex;
    align-items: center;
    margin: 0 auto;
    justify-content: center;
  }
  .h {
    margin-right: 15px;
  }
  text-align: center;
}
</style>
